package net
{
	import flash3.net.ByteArrayPlus;
	import flash3.net.MsgPacket;
	
	import net.MessageDef;

	public class RoomLoginGroup extends MessageGroup
	{
		//登录数据包定义
		public static const MDM_GR_LOGON:uint					=	1									//房间登录	
			
		public static const SUB_GR_LOGON_ACCOUNTS:uint		=	1									//帐户登录
		public static const SUB_GR_LOGON_USERID:uint			=	2									//I D 登录	
			
		public static const SUB_GR_LOGON_SUCCESS:uint			=	100									//登录成功
		public static const SUB_GR_LOGON_ERROR:uint			=	101									//登录失败
		public static const SUB_GR_LOGON_FINISH:uint			=	102									//登录完成
			
		public function RoomLoginGroup()
		{
			super();
		}
		
		override public function defMessage():void
		{
			addMessage(new MessageDef(MDM_GR_LOGON, SUB_GR_LOGON_ACCOUNTS, "账户登录", onLoginAccounts));
			addMessage(new MessageDef(MDM_GR_LOGON, SUB_GR_LOGON_USERID, "账户登录", onLoginUserID));
			addMessage(new MessageDef(MDM_GR_LOGON, SUB_GR_LOGON_SUCCESS, "账户登录", onLoginSuccess));
			addMessage(new MessageDef(MDM_GR_LOGON, SUB_GR_LOGON_ERROR, "账户登录", onLoginError));
			addMessage(new MessageDef(MDM_GR_LOGON, SUB_GR_LOGON_FINISH, "账户登录", onLoginFinish));
		}
		
		public function onLoginAccounts(packet:MsgPacket, data:Array):void
		{
			var bap:ByteArrayPlus = packet._data;
			bap.writeString(data[0]);
			bap.writeString(data[1]);
		}
		public function onLoginUserID(packet:MsgPacket, data:Array):void
		{
			
		}
		public function onLoginSuccess(packet:MsgPacket):void
		{
			
		}
		public function onLoginError(packet:MsgPacket):void
		{
			
		}
		public function onLoginFinish(packet:MsgPacket):void
		{
			
		}
	}
}